﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="InventoryManagementSystem.ReportPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:InventoryManagementSystem"
    xmlns:common="using:InventoryManagementSystem.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:charting="using:WinRTXamlToolkit.Controls.DataVisualization.Charting">
    <Grid Style="{StaticResource LayoutRootStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="报告" Style="{StaticResource PageHeaderTextStyle}"/>
            <!--<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="0, 0, 0, 20" HorizontalAlignment="Right" VerticalAlignment="Bottom">
                <Button BorderThickness="0">
                    <StackPanel>
                        <Path Data="M45.963548,8.269645L62.665147,25.065546 45.963548,39.871244 45.963548,31.963644C45.963548,31.963644 17.120617,24.075571 9.909945,39.871244 9.9099454,35.922571 12.530199,16.167482 45.963548,16.167483z M0,0L41.778571,0 41.778571,4.1795139 41.778571,8.3590277 37.598714,8.3590277 37.598714,4.1795139 4.1798577,4.1795139 4.1798577,45.954649 37.598714,45.954649 37.598714,41.775137 41.778571,41.775137 41.778571,45.954649 41.778571,50.134165 37.598714,50.134165 0,50.134165 0,45.954649 0,4.1795139z" Stretch="Uniform" Fill="#FFFFFFFF" Width="64" Height="64"/>
                        <TextBlock TextAlignment="Center">导出</TextBlock>
                    </StackPanel>
                </Button>
                <Button BorderThickness="0">
                    <StackPanel>
                        <Path Data="M13.338,28.512001L50.661999,28.512001 50.661999,52.741999 13.338,52.741999z M0,6.9750004L9.1771202,6.9750004 9.1771202,13.338428 54.944,13.338428 54.944,6.9750004 64,6.9750004 64,35.609999 54.944,35.609999 54.944,24.107311 9.1771202,24.107311 9.1771202,35.609999 0,35.609999z M13.277,0L50.723,0 50.723,9.4230003 13.277,9.4230003z" Stretch="Uniform" Fill="#FFFFFFFF" Width="64" Height="64"/>
                        <TextBlock TextAlignment="Center">打印</TextBlock>
                    </StackPanel>
                </Button>
                <Grid Width="50"/>
            </StackPanel>-->
        </Grid>

        <StackPanel x:Name="inProgressRingStackPanel" Grid.Row="1" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center">
            <ProgressRing Width="64" Height="64" IsActive="True"/>
            <TextBlock x:Name="inProgressTextBlock" FontSize="24" Margin="0, 20, 0, 0"/>
        </StackPanel>
        
        <Grid x:Name="contentGrid" Grid.Row="1">
            <FlipView ItemsSource="{Binding Charts}">
                <FlipView.ItemTemplate>
                    <DataTemplate>
                        <charting:Chart Title="{Binding Path=Title}" Margin="50, 50, 50, 50">
                            <charting:Chart.Series>
                                <charting:ColumnSeries
                                        Title="销售额"
                                        ItemsSource="{Binding Path=Data}"
                                        DependentValueBinding="{Binding Value}"                 
                                        IndependentValueBinding="{Binding Name}"
                                        IsSelectionEnabled="True"/>
                            </charting:Chart.Series>
                        </charting:Chart>
                    </DataTemplate>
                </FlipView.ItemTemplate>
            </FlipView>
        </Grid>
    </Grid>
</common:LayoutAwarePage>
